package com.slz3.business.module.systemManagement.sysRole.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.systemManagement.sysRole.domain.SysRole;
import com.slz3.business.module.systemManagement.sysRole.domain.SysRoleCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SysRoleResAtomic {

    static Mono<ServerResponse> add_$SysRoleUpdateLock(ServerRequest req, SysRole sysRole) {
        return SysRoleResSafeValid.add(req, sysRole) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleResExecutor.add(req, sysRole);
    }

    public static Mono<ServerResponse> delete_$SysRoleUpdateLock(ServerRequest req, SysRoleCondition sysRoleCondition) {
        return SysRoleResSafeValid.delete(req, sysRoleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$SysRoleUpdateLock(ServerRequest req, SysRole sysRole) {
        return SysRoleResSafeValid.modify(req, sysRole) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleResExecutor.modify(req, sysRole);
    }

    static Mono<ServerResponse> info_$SysRoleUpdateLock(ServerRequest req) {
        return SysRoleResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$SysRoleUpdateLock(ServerRequest req, SysRoleCondition sysRoleCondition) {
        return SysRoleResSafeValid.auditSubmit(req, sysRoleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$SysRoleUpdateLock(ServerRequest req, SysRoleCondition sysRoleCondition) {
        return SysRoleResSafeValid.audit(req, sysRoleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$SysRoleUpdateLock(ServerRequest req, SysRoleCondition sysRoleCondition) {
        return SysRoleResSafeValid.auditReject(req, sysRoleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$SysRoleUpdateLock(ServerRequest req, SysRoleCondition sysRoleCondition) {
        return SysRoleResSafeValid.usingEnable(req, sysRoleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$SysRoleUpdateLock(ServerRequest req, SysRoleCondition sysRoleCondition) {
        return SysRoleResSafeValid.usingDisable(req, sysRoleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleResExecutor.usingDisable(req);
    }
}
